import Vue from 'vue'
import VueRouter from 'vue-router'
import home from '../views/home.vue'

import shop_show from '@/views/shop_show'
import order_show from '@/views/order_show'
import property_show from '@/views/property_show'
import coupon_show from '@/views/coupon_show'
import advertisement_show from '@/views/advertisement_show'
import advertisement_add from '@/views/advertisement_add'
import coupon_add from '@/views/coupon_add'
import user_show from '@/views/user_show'
import activity_show from '@/views/activity_show'
import activity_add from '@/views/activity_add'
import login from '@/views/login'
import index from '@/views/index'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
 
  {
    path:'/login',
    component:login
  },
  {
    path: '/home',
    component: home,
    redirect: '/home/index',
    children:[
      {
        path:'index',
        component:index
      },
      {
        path:'activity-add',
        name:'activity-add',
        component:activity_add
      },
      {
        path:'activity-show',
        name:'activity-show',
        component:activity_show
      },
      {
        path:'user-show',
        name:'user-show',
        component:user_show
      },
      {
        path:'advertisement-add',
        name:'advertisement-add',
        component:advertisement_add
      },
      {
        path:'advertisement-show',
        name:'advertisement-show',
        component:advertisement_show
      },
      {
        path:'coupon-show',
        name:"coupon-show",
        component:coupon_show
      },
      {
        path:'coupon-add',
        name:"coupon-add",
        component:coupon_add
      },
      {
        path:'shop-show',
        name:'shop-show',
        component:shop_show
      },
      {
        path:'order-show',
        name:'order-show',
        component:order_show
      },
      {
        path:"property-show",
        name:"property-show",
        component:property_show
      }
    ]
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
